from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

#滚动到浏览器顶部
js_top = "var q=document.documentElement.scrollTop=0"

#滚动到浏览器底部
js_bottom = "var q=document.documentElement.scrollTop=10000"
js_bottom2 = "window.scrollTo(0,document.body.scrollHeight)"

#滑动至元素位置
user = customer.find_element_by_css_selector('._23y9lFCn')


driver = webdriver.Chrome()
driver.get(url)
driver.execute_script("arguments[0].scrollIntoView();", user)
driver.execute_script(js_bottom)
driver.execute_script(js_top)
driver.close()
